package com.itheima.controller;

import com.itheima.entity.Category;
import com.itheima.jsonresult.JsonResult;
import com.itheima.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author linying
 * @since 2022-10-13
 */
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    /**
     * 分类列表
     * @return
     */
    @GetMapping("/list")
    public JsonResult list(){
        return categoryService.categoryListClient();
    }
}
